﻿using Microsoft.Extensions.Caching.Memory;

namespace DCommon.Caching
{
    public class MemoryCacheProvider : ICacheProvider
    {
        private readonly IMemoryCache m_MemoryCache;

        public MemoryCacheProvider(IMemoryCache memoryCache)
        {
            m_MemoryCache = memoryCache;
        }

        public ICache CreateCache(string name)
        {
            return new MemoryCacheFacade(m_MemoryCache, name);
        }
    }
}
